using System.Collections.Generic;
using UnityEngine;

namespace HEFramework
{
    /// <summary>
    /// SkillEffect data,SkillEffect.xlsx
    /// </summary>
    public class DRSkillEffect:IData
    {
        
        /// <summary>
        /// ID  different
        /// </summary>
        public int ID { get; protected set; }
        /// <summary>
        /// 名称  outputKey
        /// </summary>
        public string Name { get; protected set; }
        /// <summary>
        /// 描述  outputKey
        /// </summary>
        public string Description { get; protected set; }
        /// <summary>
        /// AB路径  
        /// </summary>
        public string ABPath { get; protected set; }
        /// <summary>
        /// AB昵称  
        /// </summary>
        public string ABName { get; protected set; }
        /// <summary>
        /// 音效路径  
        /// </summary>
        public string SoundPath { get; protected set; }
        /// <summary>
        /// 音效名称  
        /// </summary>
        public string SoundName { get; protected set; }
        /// <summary>
        /// 特效路径  
        /// </summary>
        public string ParticlePath { get; protected set; }
        /// <summary>
        /// 特效名称  
        /// </summary>
        public string ParticleName { get; protected set; }
        /// <summary>
        /// 区域类型  
        /// </summary>
        public int AreaType { get; protected set; }
        /// <summary>
        /// 目标类型  
        /// </summary>
        public int TargetType { get; protected set; }
        /// <summary>
        /// 目标属性类型组  
        /// </summary>
        public int[] TargetATypes { get; protected set; }
        /// <summary>
        /// 范围类型  
        /// </summary>
        public int RangeType { get; protected set; }
        /// <summary>
        /// 半径（厘米）  
        /// </summary>
        public int Radius { get; protected set; }
        /// <summary>
        /// 角度（0~360）  
        /// </summary>
        public int Angle { get; protected set; }
        /// <summary>
        /// 速度（厘米/S）  
        /// </summary>
        public int Speed { get; protected set; }
        /// <summary>
        /// 销毁时间（毫秒）  
        /// </summary>
        public int DisappearTime { get; protected set; }
        /// <summary>
        /// 是否Buff  
        /// </summary>
        public int IsBuff { get; protected set; }
        /// <summary>
        /// 持续时间（毫秒）  
        /// </summary>
        public int Duration  { get; protected set; }
        /// <summary>
        /// 是否刷新周期  
        /// </summary>
        public int IsReDuration  { get; protected set; }
        /// <summary>
        /// 是否结束周期  
        /// </summary>
        public int IsEndDuration { get; protected set; }
        /// <summary>
        /// 初始化冷却  
        /// </summary>
        public int IsCooldown { get; protected set; }
        /// <summary>
        /// 冷却时间（毫秒）  
        /// </summary>
        public int Cooldown { get; protected set; }
        /// <summary>
        /// 初始数量  
        /// </summary>
        public int StackNum { get; protected set; }
        /// <summary>
        /// 叠增数量  
        /// </summary>
        public int StackPlusNum { get; protected set; }
        /// <summary>
        /// 叠减数量  
        /// </summary>
        public int StackMinusNum { get; protected set; }
        /// <summary>
        /// 叠加上限  
        /// </summary>
        public int StackMax { get; protected set; }
        /// <summary>
        /// 条件类型A组  
        /// </summary>
        public int[] ConditionATypes { get; protected set; }
        /// <summary>
        /// 条件A数值组  
        /// </summary>
        public int[] ConditionAValues { get; protected set; }
        /// <summary>
        /// 判断组  
        /// </summary>
        public int[] JudgenTypes { get; protected set; }
        /// <summary>
        /// 条件类型B组  
        /// </summary>
        public int[] ConditionBTypes { get; protected set; }
        /// <summary>
        /// 条件数值组  
        /// </summary>
        public int[] ConditionBValues { get; protected set; }
        /// <summary>
        /// 效果A  
        /// </summary>
        public int EffectAType { get; protected set; }
        /// <summary>
        /// 效果B  
        /// </summary>
        public int EffectBType { get; protected set; }
        /// <summary>
        /// 属性类型组  
        /// </summary>
        public int[] AttributeTypes { get; protected set; }
        /// <summary>
        /// 属性值组  
        /// </summary>
        public int[] AttributeValues { get; protected set; }
        /// <summary>
        /// 奖励ID组  
        /// </summary>
        public int[] RewardIDs { get; protected set; }
        /// <summary>
        /// 奖励值组  
        /// </summary>
        public int[] RewardValues { get; protected set; }
        /// <summary>
        /// 计数  
        /// </summary>
        public int Count { get; protected set; }
        /// <summary>
        /// 效果ID  
        /// </summary>
        public int EffectID { get; protected set; }
        /// <summary>
        /// 物体ID  
        /// </summary>
        public int ItemID { get; protected set; }

        
        public void ParseDataRow(string input)
        {
            string[] text = input.Split('	');
            int index = 0;
        
            ID = int.Parse(text[index++]);
            Name = DataTableExtension.GetStringFromKey(text[index++]);
            Description = DataTableExtension.GetStringFromKey(text[index++]);
            ABPath = text[index++];
            ABName = text[index++];
            SoundPath = text[index++];
            SoundName = text[index++];
            ParticlePath = text[index++];
            ParticleName = text[index++];
            AreaType = int.Parse(text[index++]);
            TargetType = int.Parse(text[index++]);
            TargetATypes = DataTableExtension.ParseIntArr(text[index++]);
            RangeType = int.Parse(text[index++]);
            Radius = int.Parse(text[index++]);
            Angle = int.Parse(text[index++]);
            Speed = int.Parse(text[index++]);
            DisappearTime = int.Parse(text[index++]);
            IsBuff = int.Parse(text[index++]);
            Duration  = int.Parse(text[index++]);
            IsReDuration  = int.Parse(text[index++]);
            IsEndDuration = int.Parse(text[index++]);
            IsCooldown = int.Parse(text[index++]);
            Cooldown = int.Parse(text[index++]);
            StackNum = int.Parse(text[index++]);
            StackPlusNum = int.Parse(text[index++]);
            StackMinusNum = int.Parse(text[index++]);
            StackMax = int.Parse(text[index++]);
            ConditionATypes = DataTableExtension.ParseIntArr(text[index++]);
            ConditionAValues = DataTableExtension.ParseIntArr(text[index++]);
            JudgenTypes = DataTableExtension.ParseIntArr(text[index++]);
            ConditionBTypes = DataTableExtension.ParseIntArr(text[index++]);
            ConditionBValues = DataTableExtension.ParseIntArr(text[index++]);
            EffectAType = int.Parse(text[index++]);
            EffectBType = int.Parse(text[index++]);
            AttributeTypes = DataTableExtension.ParseIntArr(text[index++]);
            AttributeValues = DataTableExtension.ParseIntArr(text[index++]);
            RewardIDs = DataTableExtension.ParseIntArr(text[index++]);
            RewardValues = DataTableExtension.ParseIntArr(text[index++]);
            Count = int.Parse(text[index++]);
            EffectID = int.Parse(text[index++]);
            ItemID = int.Parse(text[index++]);

        }
        
        private void AvoidJIT()
        {
            new Dictionary<int, DRSkillEffect>();
        }
    }
}